<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Testing</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="oci8.installation.html">« 安装</a></li>
      <li style="float: right;"><a href="oci8.configuration.html">运行时配置 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="oci8.setup.html">安装/配置</a></li>
    <li>Testing</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="oci8.test" class="section">
  <h2 class="title">Testing</h2>
   <div class="section" id="oci8.testing">
    <p class="para">
     The OCI8 test suite is in <var class="filename">ext/oci8/tests</var>.
     After OCI8 tests are run this directory will also contain logs of
     any failures.
    </p>
   </div>
   <div class="section">
    <p class="para">
     Before running PHP&#039;s tests, edit <var class="filename">details.inc</var>
     and set $user, $password and the $dbase connection string.  The
     OCI8 test suite has been developed using
     the <code class="literal">SYSTEM</code> account.  Some tests will fail if
     the test user does not have equivalent permissions.
    </p>
    <p class="para">
     If Oracle Database Resident Connection Pooling is being
     tested, set $test_drcp to <strong><code>true</code></strong> and ensure the
     connection string uses an appropriate DRCP pooled server.
    </p>
    <p class="para">
     An alternative to editing <var class="filename">details.inc</var> is the
     set environment variables, for example:
     <div class="example-contents">
<div class="cdata"><pre>
    $ export PHP_OCI8_TEST_USER=system
    $ export PHP_OCI8_TEST_PASS=oracle
    $ export PHP_OCI8_TEST_DB=localhost/XE
    $ export PHP_OCI8_TEST_DRCP=FALSE
</pre></div>
     </div>

     Note in some shells these variables are not propagated correctly
     to the PHP process and tests will fail to connect if this method
     is used.
    </p>
    <p class="para">
     Next, set any necessary environment for the Oracle database.  If you are
     running PHP on the same machines as Oracle Database, you can run:
   <div class="example-contents">
<div class="cdata"><pre>
    $ . /usr/local/bin/oraenv
</pre></div>
   </div>

    </p>
    <p class="para">
     With Oracle 11<em class="emphasis">g</em>R2 XE do:
     <div class="example-contents">
<div class="cdata"><pre>
    $ . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
</pre></div>
     </div>

    </p>
    <p class="para">
     Some shells require that <var class="filename">php.ini</var> has <code class="literal">E</code> in the
     variables_order parameter, for example:
     <div class="example-contents">
<div class="cdata"><pre>
    variables_order = &quot;EGPCS&quot;
</pre></div>
     </div>

    </p>
    <p class="para">
     Run all the PHP tests with:
   <div class="example-contents">
<div class="cdata"><pre>
    $ cd your_php_src_directory
    $ make test
</pre></div>
   </div>

   or run only the OCI8 tests with
   <div class="example-contents">
<div class="cdata"><pre>
    $ cd your_php_src_directory
    $ make test TESTS=ext/oci8
</pre></div>
   </div>

    </p>
    <p class="para">
      When the tests have completed, review any test failures. On slow
      systems, some tests may take longer than the default test
      timeout in <var class="filename">run-tests.php</var>.  To correct this,
      set the environment variable <code class="literal">TEST_TIMEOUT</code> to
      a larger number of seconds.
    </p>
    <p class="para">
     On fast machines with a local database configured for light load
     (e.g. Oracle 11<em class="emphasis">g</em>R2 XE) some tests might fail with ORA-12516 or
     ORA-12520 errors.  To prevent this, increase the database
     <code class="literal">PROCESSES</code> parameter using the following steps:
    </p>
    <p class="para">
     Connect as the oracle software owner:
     <div class="example-contents">
<div class="cdata"><pre>
    $ su - oracle
</pre></div>
     </div>

    </p>
    <p class="para">
     Set the necessary Oracle environment with <var class="filename">oracle_env.sh</var> or
     <var class="filename">oraenv</var>, as described above.
    </p>
    <p class="para">
     Start the SQL*Plus command line tool and
     increase <code class="literal">PROCESSES</code>
     <div class="example-contents">
<div class="cdata"><pre>
    $ sqlplus / as sysdba
    SQL&gt; alter system set processes=100 scope=spfile
</pre></div>
     </div>

    </p>
    <p class="para">
     Restart the database:
     <div class="example-contents">
<div class="cdata"><pre>
    SQL&gt; startup force
</pre></div>
     </div>

    </p>
   </div>
 </div></div></div></body></html>